home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_08_07
/
8n07088a
< prev
next >
Wrap
Text File
|
1990-06-17
|
761b
|
29 lines
#include <stdio.h>
struct record
{
char first_name[15];
char last_name[15];
};
main()
{
struct record rec;
FILE *fptr;
fptr = fopen("test.fil","rt");
fread(&rec, sizeof(rec), 1, fptr);
printf("First Name: %s\n", rec.first_name);
printf("Last Name : %s\n", rec.last_name);
fclose(fptr);
}
Sample file generated by BASIC PRINT#:
a123456789012345b23456789012345
Sample output from C:
First Name: a23456789012345b23456789012345
Last Name : b23456789012345